from django.db import models
from meiduo_mall.utils.models import BaseModel


class OAuthQQUser(BaseModel):
    user = models.ForeignKey('users.User', on_delete=models.CASCADE, verbose_name='关联的用户')
    open_id = models.CharField(max_length=64, verbose_name='qq用户的标识符')

    class Meta:
        db_table = 'tb_oauth_qq_user'


class OAuthSinaUser(BaseModel):
    user = models.ForeignKey('users.User', unique=True, on_delete=models.CASCADE, verbose_name='关联的用户')
    access_token = models.CharField(max_length=64, unique=True, verbose_name='新浪用户的标识符')

    class Meta:
        db_table = 'tb_oauth_sina_user'
